package com.miyake.dsp.converter;

import com.miyake.dsp.ComplexArray;
import com.miyake.dsp.Processor;

public class Invert implements Processor {

	private ComplexArray source;
	private InvertSetting setting;

	public Invert(InvertSetting setting) {
		this.setting = setting;
	}
	
	@Override
	public void setSource(ComplexArray source) {
		this.source = source;
	}

	@Override
	public ComplexArray getSource() {
		return this.source;
	}

	@Override
	public ComplexArray getProcessed() {
		double[] real = new double[source.getRealPart().length];
		for (int i = 0; i < real.length; i++) {
			real[i] = source.getRealPart()[real.length - i - 1];
		}
		ComplexArray ret = new ComplexArray(real);
		return ret;
	}

	@Override
	public Object getSetting() {
		return this.setting;
	}

}
